<template>
	<view>
		<view class="content">
			<view class="fun">
				<view class="up">
					<view class="left">
						<view class="name">
							{{info.now_title}}
						</view>
					</view>
					<view class="right">
						<image :src="img_pre+info.transparent_logo" mode=""></image>
					</view>
				</view>
				<view class="down">
					<view class="view">
						<view class="left">
							{{info.nextmanor_jingyan}}<text class="t1">/{{info.self_jingyan}}</text> <text
								class="t2">经验值</text>
						</view>
					</view>
					<u-line-progress :showPercent="false" height="17" activeColor="#FB683D" :percent="info.now_scale">
					</u-line-progress>
					<view class="view">
						<view class="right">
							还需{{info.self_jingyan}}经验值、分享{{info.self_tuijian}}人，可升级
						</view>
					</view>
				</view>
			</view>
			<view class="title">
				<view class="up">
					蜂巢权限要求
				</view>
				<view class="down">
					抢拍超级蜂巢可提前<text>开启权限</text>
				</view>
			</view>
			<view class="task">
				<u-row>
					<u-col :span="6" v-for="(item,index) in info.list" :key="index">
						<view class="list" :class="'a'+index">
							<view class="icon">
								<image :src="img_pre+ item.manor_logo"></image>
							</view>
							<view class="cont">
								<view class="name">
									{{item.title}}
								</view>
								<view class="text" v-if="index==0">
									无分享人数和经验值限制
								</view>
								<view class="text" v-else>
									分享好友<text>{{item.tuijian}}</text>人 积分经验值<text>{{item.jingyan}}</text>
								</view>
							</view>
							<view class="go" @click="gift(item)" v-if="index!=0">
								<image src="../static/a8.png" mode=""></image>
							</view>
						</view>
					</u-col>
				</u-row>
			</view>
		</view>
		<u-popup v-model="show" :closeable="true" close-icon-pos="top-left" borderRadius="10" mode="bottom">
			<view class="gift">
				<view class="_view">
					<view class="title_item">
						开启
					</view>
					<view class="text">
						提前开启需要待产出当前权限蜂巢{{manor_power_need_number}}块，已经产出
					</view>
					<view class="number">
						{{manor_power_already_number}} <text>块</text>
					</view>
				</view>
				<view class="button">
					<button type="default" v-if="manor_power==1" class="b1" @click="getUpgrade">开启蜂巢</button>
					<button type="default" v-else class="b2" @click="zhidao">开启蜂巢</button>
				</view>
				<view class="popup_top"></view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				background: {
					'background': '#F3B35B'
				},
				percent: 50,
				info: {
					now_scale: 0
				},
				manor_power: 0,
				manor_power_need_number: 0,
				manor_power_already_number: 0,
				show: false,
				show1: false,
				maid: ""
			}
		},
		onLoad(option) {
			than = this;
			than.post("api/Villa/listOfData", null, function(data) {
				than.info = data;
			})
		},
		methods: {
			gift(item) {
				than.manor_power = item.manor_power
				than.manor_power_already_number = item.manor_power_already_number
				than.manor_power_need_number = item.manor_power_need_number
				than.maid = item.maid
				than.show = true
			},
			getUpgrade() {
				than.show = false
				than.post("api/Villa/getUpgrade", {
					maid: than.maid
				}, function(data) {
					than.toast(data)
				})
			}
		}
	}
</script>

<style lang="less">
	.gift {
		text-align: center;

		.popup_top {
			height: 30rpx;
		}

		._view {
			background: #FFFFFF;

			.title_item {
				height: 108rpx;
				line-height: 108rpx;
				font-size: 38rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
				border-bottom: 1px solid #F6F6F6;
			}

			.text {
				margin-top: 63rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;
			}

			.number {
				margin-top: 60rpx;
				font-size: 48rpx;
				font-family: DINCond-Black;
				font-weight: bold;
				color: #FB683D;
				padding-bottom: 20rpx;

				text {
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: bold;
				}
			}

			.image {
				width: 100%;
				height: 478rpx;
				background-size: 100% 100%;
				background-image: url(../static/a2.png);

				.img {
					margin-top: 40rpx;
					width: 170rpx;
					height: 170rpx;
				}
			}
		}

		.button {
			margin: 51rpx auto 0;

			.b1 {
				border-radius: 40rpx;
				border: 0;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				width: 245rpx;
				height: 74rpx;
				background: #FB683D;
				border-radius: 20rpx;
				margin-bottom: 40rpx;
			}

			.b2 {
				border-radius: 40rpx;
				border: 0;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				width: 245rpx;
				height: 74rpx;
				background: #D1D1D1;
				border-radius: 20rpx;
				margin-bottom: 40rpx;
			}
		}
	}



	page {
		background: #FAFAFA;
	}

	.content {
		position: relative;
		z-index: 1;
		padding: 20rpx 35rpx 0;

		.task {
			margin-top: 24rpx;
			border-radius: 20rpx;

			.a0 {
				background: #FCF5EA;
			}

			.a1 {
				background: #F5F6FA;
			}

			.a2 {
				background: #F3F9F9;
			}

			.a3 {
				background: #FAF5F5;
			}

			.list {
				height: 357rpx;
				border-radius: 20rpx;
				margin-bottom: 35rpx;
				text-align: center;
				padding-top: 30rpx;

				.icon {
					width: 124rpx;
					height: 124rpx;
					border-radius: 10rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					border-radius: 97rpx;
					margin: auto;

					image {
						border-radius: 97rpx;
						width: 100%;
						height: 100%;
					}
				}

				.cont {

					.name {
						margin-bottom: 10rpx;
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
					}

					.text {
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #666666;
						display: flex;
						align-items: center;
						justify-content: center;

						text {
							color: #F66337;
						}

						image {
							width: 24rpx;
							height: 24rpx;
						}
					}
				}

				.go {
					margin: auto;
					width: 123rpx;
					height: 123rpx;
					text-align: center;

					image {
						width: 100%;
						height: 100%;
					}
				}

			}
		}

		.fun {
			width: 678rpx;
			height: 315rpx;
			background-image: url(../static/b1.png);
			background-size: 100% 100%;
			border-radius: 20rpx;
			margin: auto;

			.up {
				align-items: center;
				display: flex;
				margin-top: 15rpx;
				padding: 0 27rpx;

				.left {
					width: 480rpx;

					.name {
						height: 141rpx;
						line-height: 141rpx;
						font-size: 48rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
					}

					.icon {
						align-items: center;
						display: flex;

						.list {
							padding: 0 12rpx;
							margin-right: 12rpx;
							height: 48rpx;
							line-height: 48rpx;
							background: #F0E2BC;
							border-radius: 24rpx;
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #6E5245;
						}
					}
				}

				.right {
					margin-left: auto;

					image {
						padding-top: 36rpx;
						width: 133rpx;
						height: 133rpx;
					}
				}
			}

			.down {
				padding: 0 26rpx;
				width: 500rpx;

				.view {
					display: flex;
					align-items: center;

					.left {
						font-size: 38rpx;
						font-family: DIN Medium;
						font-weight: 400;
						color: #333333;

						.t1 {
							font-size: 32rpx;
							font-family: DIN Medium;
							font-weight: 400;
							color: #E1A156;
						}

						.t2 {

							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #E1A156;
						}
					}

					.right {
						display: flex;
						align-items: center;
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #5E646E;

						.name {

							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #8287A4;
						}

						image {
							width: 31rpx;
							height: 34rpx;
						}
					}
				}
			}
		}

		.title {

			margin-top: 30rpx;

			.up {
				height: 80rpx;
				line-height: 80rpx;
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.down {
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;

				text {
					color: #F46813;
				}
			}
		}
	}
</style>
